#GECKO_SDK = /Users/julien/work/xul/xpcom/gecko-sdk
GECKO_SDK = /Users/marisa/Projects/gecko-sdk
XULRUNNER = /Library/Frameworks/XUL.Framework/Versions/Current
TMP3_COMPONENTS = ../TMP3.app/Contents/Resources/components

XPIDL = $(GECKO_SDK)/bin/xpidl
IFLAGS = -I$(GECKO_SDK)/idl
IDL = xmIPlayer.idl xmITrack.idl
HEADERS = $(IDL:.idl=.h)
XPT = $(IDL:.idl=.xpt)

CFLAGS = -w -I$(GECKO_SDK)/include -I/System/Library/Frameworks/QuickTime.framework/Versions/Current/Headers -DXP_UNIX -DXP_MACOSX
LDFLAGS = -dynamiclib -L$(GECKO_SDK)/lib -L$(XULRUNNER) -Wl,-framework,QuickTime -Wl,-framework,Carbon -Wl,-executable_path,$(XULRUNNER) -lxpcomglue_s -lxpcom -lnspr4
OBJECTS = QuickModule.o QuickPlayer.o QuickTrack.o 
LIBRARY = libxmMusic.dylib

CP = cp -f
LN = ln -sf

all:	$(LIBRARY)
xpt:	$(XPT)

%.h:	%.idl
	$(XPIDL) $(IFLAGS) -m header $<

%.xpt:	%.idl
	$(XPIDL) $(IFLAGS) -m typelib $<

.cpp.o:
	$(CXX) $(CFLAGS) -c -o $@ $<

$(LIBRARY):	$(HEADERS) $(OBJECTS)
	$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)

clean:
	$(RM) $(HEADERS) $(XPT) $(OBJECTS) $(LIBRARY)
